<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../../common/jsp/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>结算管理-库存盘点一览</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<%@ include file="../../../common/jsp/config.jsp"%>
<script type="text/javascript" src="common/js/calendar/WdatePicker.js" ></script>
<script type="text/javascript">
    function querySubmit() {
    	$("#queryMaterialsMonthInventoryCheckList").submit();
    	return false;
    }
    
    function addInventoryCheck() {
     	alertDialog(800, 500, "newMaterialsMonthInventoryCheck.action", 
    	    	function (result) {
    	    		if (result == DIALOG_RESULT_TYPE_SUCCESS) {
    	    			alert("保存成功");
    	    			$("#queryMaterialsMonthInventoryCheckList").submit();
    	    		}
    	    	});
    }
	function deleteItem(id) {
		if (window.confirm('确定要删除这个盘点表吗?')==true) {
			$("#queryMaterialsMonthInventoryCheckList").attr("action", "deleteInventoryCheck.action?checkNo=" + id);
	    	$("#queryMaterialsMonthInventoryCheckList").submit();
		}
	}
	function adjustMaterialsInventory(id) {
		if (window.confirm('确定要对这次的盘点结果调帐吗?')==true) {
			$("#queryMaterialsMonthInventoryCheckList").attr("action", "adjustMaterialsInventory.action?checkNo=" + id);
	    	$("#queryMaterialsMonthInventoryCheckList").submit();
		}
	}
  	$(document).ready(function() {
		
	});
</script>
</HEAD>
<BODY>
    <div class="subnav" align="left">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="common/images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">结算管理</span>
			&nbsp;<img src="common/images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">库存盘点一览</span></td>
		  </tr>
		</table>
    </div>
	  <div class="btn-bottom" align="right"> 
		<input type="button" value="新建盘点计划" onclick="addInventoryCheck()"  class="inputlong" />
	  </div>
   <div class="divborder">
      <s:form action="queryMaterialsMonthInventoryCheckList">
        <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr>
            <td width="10%" align="right">年份</td>
            <td width="25%">
				<s:textfield name="queryDate" onclick="WdatePicker({dateFmt:'yyyy'})" readonly="true" size="10" />
			</td>
            <td width="10%" align="right">分类</td>
            <td width="25%">
			  <s:select id="root_category"
          		name="rootCategory"
          		list="rootCategoryList"
          		listKey="id"
          		listValue="name"
          		headerKey="-1"
          		headerValue="-请选择-" />
			</td>
            <td align="right"><input name="button" type="button" class="input1" value="查 询" onclick="querySubmit()"/></td>
          </tr>
        </table>
      </s:form>
    </div>
  <div class="ksglxx2">
      <table width="100%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a">
        <tr class="ksglxx2bg">
          <th width="95px" >单号</th>
 		  <th width="95px" >盘点日期</th>
 		  <th width="95px" >盘点月份</th>
          <th width="180px" >盘点分类</th>
          <th width="95px" >盘点总数</th>
          <th width="95px" >总金额</th>
		  <th width="95px">实际金额</th>
		  <th width="50px">差额</th>
		  <th width="50px">状态</th>
		  <th></th>
		</tr>
		<s:iterator value="inventoryChecks" id="detail" status="st">
	      <s:if test="#st.Odd">
	        <tr class="odd">
	      </s:if >
	      <s:else>
	        <tr class="even">
	      </s:else>
              <td><span class="detail">
                <a href='viewInventoryCheckInfo.action?checkNo=<s:property value="#detail.checkNo" />'><s:property value="#detail.checkNo" /></a>
              </span></td>
              <td><s:date name="#detail.checkDate"  format="yyyy-MM-dd"/></td>
              <td><s:property value="#detail.monthNo" /></td>
              <td><s:property value="#detail.categoryNames" /></td>
              <td><s:property value="#detail.count" /></td>
              <td><s:property value="#detail.amount" /></td>
              <td><s:property value="#detail.realAmount" /></td>
              <td><s:property value="#detail.diffAmount" /></td>
              <td><s:property value="#detail.statusName" /></td>
              <td align="center">
                <s:if test="#detail.status==1">
               	<span class="skin-blue">
               	  <a class="small-btn" href='editInventoryCheckInfo.action?checkNo=<s:property value="#detail.checkNo" />'>盘点</a>
               	</span>
               	<span class="skin-red">
               	  <a class="small-btn" href=javascript:deleteItem('<s:property value="#detail.checkNo" />')>删除</a>
               	</span>
               	</s:if>
               	<s:elseif test="#detail.status==2">
               	<span class="skin-blue">
               	  <a class="small-btn" href='editInventoryCheckInfo.action?checkNo=<s:property value="#detail.checkNo" />'>修改</a>
               	</span>
               	<span class="skin-red">
               	  <a class="small-btn" href=javascript:adjustMaterialsInventory('<s:property value="#detail.checkNo" />')>调帐</a>
               	</span>
               	</s:elseif>
              </td>
	        </tr>
	    </s:iterator>
       </table>
      </div>
</BODY></HTML>
